<%@page import="org.soenea.doitall.domain.model.group.Group"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Browse Groups</title>
</head>
<body>
<h2>Browse Groups</h2>
<ul>
  <c:if test="${!empty warning}"> <b>Warning: </b> ${warning}<br/>
  </c:if>
  <c:forEach items="${groups}" var="group">
    <%-- We could use "${pageContext.request.contextPath}/app/..." as part of the href. --%>
    <li>
      <form action="group/${group.id}" method="post" id="delete${group.id}">
        <div> <a href="group/${group.id}">${group.name}</a>
          <input name="command" type="hidden" value="DeleteGroup"/>
          <input type="submit" name="button" id="button" value="Delete"/>
        </div>
      </form>
    </li>
  </c:forEach>
</ul>
<!-- 
<h3>Modify a person:</h3>
<form id="ModifyPersonForm" name="ModifyPersonForm" method="post" action="">
<fieldset>
	<legend>Person Information</legend>
 	<div><label>Name:<input type="text" name="name" id="name" /></label></div>
 	<div><label>Age: <input type="text" name="age" id="age" /></label></div>
 	<div><label>Buddy: <input type="text" name="buddy" id="buddy" /></label></div>
 	<input type="submit" name="submit" id="submit" value="Add" />
    <input name="version" type="hidden" value="${person.version}"/>
 	<input name="command" type="hidden" value="ModifyPerson" />    
</fieldset>
</form>
 -->
 <h3>Add a group:</h3>
<form id="AddGroupForm" method="post" action="">
  <fieldset>
    <legend>Group information</legend>
    <div>
      <label>Name:
        <input type="text" name="name" id="name" />
      </label>
    </div>
    <div>
      <label>Description:
        <input type="text" name="description" id="description" />
      </label>
    </div>
    <input type="submit" name="submit" id="submit" value="Add" />
    <input name="command" type="hidden" value="AddGroup" />
  </fieldset>
</form>
<p> Return to <a href="login">main page</a> </p>
</body>
</html>